The long story short: I'm trying to schedule a SSIS package that runs a powershell script/command via a proxy account. The problem seems to be that proxy account didn't have the required permissions to run a .ps1 script, so I've changed the execution policy
to "Unrestricted" of everything that could be changed:
Scope ExecutionPolicy ----- --------------- MachinePolicy Unrestricted UserPolicy Unrestricted Process Undefined CurrentUser Unrestricted LocalMachine Unrestricted
So far, so good! But when I try to execute the SSIS package with a PS command like this:
powershell.exe -file D:\script.ps1 -FileName testme
I got the error:
AuthorizationManager check failed. + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecord Exception + FullyQualifiedErrorId : UnauthorizedAccess
And when I try the more simple command:
powershell.exe -Command &{Get-ExecutionPolicy}I get this:
Get-ExecutionPolicy : Access denied At line:1 char:3 + &{Get-ExecutionPolicy} + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-ExecutionPolicy], Managem entException + FullyQualifiedErrorId : System.Management.ManagementException,Microsoft. PowerShell.Commands.GetExecutionPolicyCommandIt's worth mentioning that I can call the regular cmdlets: dir; get-content, whoami, so powershell.exe is working fine! Anyone with an idea what's going on here?
- Edited by Vesko Jl 18 hours 26 minutes ago